class fn{
	constructor(arg) {
	    
	}
	
	loading(title='加载中...',mask=true,time=2){
				let arg = arguments
				// console.log(typeof arguments);
				if(typeof arg[0] === 'number' && !isNaN(arg[0])){
					title='加载中...'
					time=arg[0]
				}
				if(typeof arg[1] === 'number' && !isNaN(arg[1])){
					mask=true
					time=arg[1]
				}
				uni.showLoading({ 
					title:title,
					mask:mask
				})
				setTimeout(function () {
				    uni.hideLoading();
				}, time*1000);
		
	}
	toast(title,icon = "none",mask=true,duration=1500) {
			uni.showToast({ 
				title:title,
				icon:icon,
				mask:mask, 
				duration:duration,
			});
	}
	isHasImg(pathImg){  
	    var ImgObj=new Image();  
	    ImgObj.src= pathImg;  
	    if(ImgObj.fileSize > 0 || (ImgObj.width > 0 && ImgObj.height > 0)){  
	       return true;  
	     } else {  
	       return false;  
	    }  
	}  

	
	
	
	
	
}

export default new fn()